/**
 * ReportGear(2012)
 */
package net.abbp.lotter.ssq;

import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import net.abbp.lotter.ssq.data.Item;
import net.abbp.lotter.ssq.data.Reader;

/**
 * 双色球分析程序
 * 
 * @version 1.0
 * @author <a herf="lexloo@gmail.com">lexloo</a>
 * @since I500S 1.0
 * 
 *        Date：2012-2-21
 */
public class I500SMain {
    public static void main(String[] args) throws FileNotFoundException {
        System.out.println("分析程序-->开始");

        Reader reader = new Reader();
        List<Item> items = reader.readData();
        Map<Integer, Integer> map = new HashMap<Integer, Integer>();

        for (Item item : items) {
            int sum = item.getSum();
            Integer c = map.get(sum);

            if (c == null) {
                map.put(sum, 1);
            } else {
                map.put(sum, c + 1);
            }
        }

        List<Integer> vs = new ArrayList<Integer>();
        vs.addAll(map.keySet());
        Collections.sort(vs);

        for (int sum : vs) {
            System.out.println(sum + "-->" + map.get(sum));
        }

        System.out.println("分析程序-->结束");
    }
}
